﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_XacNhanDonHang : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvNhaCungCap")]
        private ADVObjects _AdvNhaCungCap;
        [AccessedThroughProperty("CboPhuongThucThanhToan")]
        private ComboBox _CboPhuongThucThanhToan;
        [AccessedThroughProperty("CboTinhTrang")]
        private ComboBox _CboTinhTrang;
        [AccessedThroughProperty("CmdCancel")]
        private Button _CmdCancel;
        [AccessedThroughProperty("CmdOK")]
        private Button _CmdOK;
        [AccessedThroughProperty("GroupBox1")]
        private GroupBox _GroupBox1;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label16")]
        private Label _Label16;
        [AccessedThroughProperty("Label18")]
        private Label _Label18;
        [AccessedThroughProperty("Label19")]
        private Label _Label19;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("Label8")]
        private Label _Label8;
        [AccessedThroughProperty("TxtHanGiaoHang")]
        private DateTimePicker _TxtHanGiaoHang;
        [AccessedThroughProperty("TxtNgayChungTu")]
        private DateTimePicker _TxtNgayChungTu;
        [AccessedThroughProperty("TxtNgayHopDong")]
        private DateTimePicker _TxtNgayHopDong;
        [AccessedThroughProperty("TxtSoChungTu")]
        private TextBox _TxtSoChungTu;
        [AccessedThroughProperty("TxtSoHopDong")]
        private TextBox _TxtSoHopDong;
        public string cFrmKhoaDonHang;
        private IContainer components;
        private clsDonDatHang objDH;

        public Frm_XacNhanDonHang()
        {
            base.Load += new EventHandler(this.Frm_XacNhanDonHang_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.cFrmKhoaDonHang = "";
            this.objDH = new clsDonDatHang();
            this.InitializeComponent();
        }

        private void CboTinhTrang_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboTinhTrang.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "CK")
            {
                this.TxtSoHopDong.ReadOnly = false;
                this.TxtNgayHopDong.Enabled = true;
                this.TxtHanGiaoHang.Enabled = true;
            }
            else
            {
                this.TxtSoHopDong.ReadOnly = true;
                this.TxtNgayHopDong.Enabled = false;
                this.TxtHanGiaoHang.Enabled = false;
            }
        }

        private void CmdOK_Click(object sender, EventArgs e)
        {
            clsDonDatHang objDH = this.objDH;
            objDH.Khoa = this.cFrmKhoaDonHang;
            objDH.TinhTrang = Conversions.ToString(this.CboTinhTrang.SelectedValue);
            objDH.SoHopDong = this.TxtSoHopDong.Text.Trim();
            objDH.NgayHopDong = LVYModule.Date2Char(this.TxtNgayHopDong.Text);
            objDH.NgayHangVeKho = LVYModule.Date2Char(this.TxtHanGiaoHang.Text);
            objDH.ConfirmOrder();
            objDH = null;
            this.Dispose();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Frm_XacNhanDonHang_Load(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoaDonHang, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                this.Dispose();
            }
            else
            {
                BuildComboModule.BuildCombo(this.CboPhuongThucThanhToan, modGeneral.ListDanhMuc.PhuongThucThanhToan, false, "", "");
                this.CboTinhTrang.DataSource = modGeneral.H_DUNGCHUNG.ShowList("0000000001");
                this.CboTinhTrang.ValueMember = "Ma";
                this.CboTinhTrang.DisplayMember = "Ten";
                this.ShowData(this.cFrmKhoaDonHang);
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_XacNhanDonHang));
            this.GroupBox1 = new GroupBox();
            this.Label2 = new Label();
            this.TxtNgayHopDong = new DateTimePicker();
            this.CboPhuongThucThanhToan = new ComboBox();
            this.Label8 = new Label();
            this.Label7 = new Label();
            this.TxtHanGiaoHang = new DateTimePicker();
            this.Label18 = new Label();
            this.TxtSoHopDong = new TextBox();
            this.CboTinhTrang = new ComboBox();
            this.Label19 = new Label();
            this.Label16 = new Label();
            this.Label13 = new Label();
            this.TxtNgayChungTu = new DateTimePicker();
            this.Label1 = new Label();
            this.TxtSoChungTu = new TextBox();
            this.CmdCancel = new Button();
            this.CmdOK = new Button();
            this.AdvNhaCungCap = new ADVObjects();
            this.GroupBox1.SuspendLayout();
            this.SuspendLayout();
            this.GroupBox1.Controls.Add(this.Label2);
            this.GroupBox1.Controls.Add(this.TxtNgayHopDong);
            this.GroupBox1.Controls.Add(this.CboPhuongThucThanhToan);
            this.GroupBox1.Controls.Add(this.Label8);
            this.GroupBox1.Controls.Add(this.Label7);
            this.GroupBox1.Controls.Add(this.TxtHanGiaoHang);
            this.GroupBox1.Controls.Add(this.Label18);
            this.GroupBox1.Controls.Add(this.TxtSoHopDong);
            this.GroupBox1.Controls.Add(this.CboTinhTrang);
            this.GroupBox1.Controls.Add(this.Label19);
            this.GroupBox1.Controls.Add(this.Label16);
            this.GroupBox1.Controls.Add(this.AdvNhaCungCap);
            this.GroupBox1.Controls.Add(this.Label13);
            this.GroupBox1.Controls.Add(this.TxtNgayChungTu);
            this.GroupBox1.Controls.Add(this.Label1);
            this.GroupBox1.Controls.Add(this.TxtSoChungTu);
            Point point = new Point(8, 5);
            this.GroupBox1.Location = point;
            this.GroupBox1.Name = "GroupBox1";
            Size size = new Size(0x19f, 210);
            this.GroupBox1.Size = size;
            this.GroupBox1.TabIndex = 0;
            this.GroupBox1.TabStop = false;
            this.GroupBox1.Text = "T\x00ecnh trạng đơn đặt h\x00e0ng";
            this.Label2.AutoSize = true;
            point = new Point(0xfe, 0x7a);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x2d, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x3f;
            this.Label2.Text = "K\x00fd ng\x00e0y";
            this.TxtNgayHopDong.Format = DateTimePickerFormat.Short;
            point = new Point(0x131, 0x77);
            this.TxtNgayHopDong.Location = point;
            this.TxtNgayHopDong.Name = "TxtNgayHopDong";
            size = new Size(0x61, 20);
            this.TxtNgayHopDong.Size = size;
            this.TxtNgayHopDong.TabIndex = 0x40;
            this.CboPhuongThucThanhToan.Enabled = false;
            this.CboPhuongThucThanhToan.FormattingEnabled = true;
            point = new Point(0x6b, 0x97);
            this.CboPhuongThucThanhToan.Location = point;
            this.CboPhuongThucThanhToan.Name = "CboPhuongThucThanhToan";
            size = new Size(0x127, 0x15);
            this.CboPhuongThucThanhToan.Size = size;
            this.CboPhuongThucThanhToan.TabIndex = 0x3e;
            this.Label8.AutoSize = true;
            point = new Point(12, 0x9a);
            this.Label8.Location = point;
            this.Label8.Name = "Label8";
            size = new Size(0x3e, 13);
            this.Label8.Size = size;
            this.Label8.TabIndex = 0x3d;
            this.Label8.Text = "Thanh to\x00e1n";
            this.Label8.TextAlign = ContentAlignment.TopRight;
            this.Label7.AutoSize = true;
            point = new Point(12, 0xb9);
            this.Label7.Location = point;
            this.Label7.Name = "Label7";
            size = new Size(0x5f, 13);
            this.Label7.Size = size;
            this.Label7.TabIndex = 0x3b;
            this.Label7.Text = "Ng\x00e0y h\x00e0ng về kho";
            this.TxtHanGiaoHang.Format = DateTimePickerFormat.Short;
            point = new Point(0x6b, 0xb6);
            this.TxtHanGiaoHang.Location = point;
            this.TxtHanGiaoHang.Name = "TxtHanGiaoHang";
            size = new Size(90, 20);
            this.TxtHanGiaoHang.Size = size;
            this.TxtHanGiaoHang.TabIndex = 60;
            this.Label18.AutoSize = true;
            point = new Point(12, 0x7a);
            this.Label18.Location = point;
            this.Label18.Name = "Label18";
            size = new Size(0x45, 13);
            this.Label18.Size = size;
            this.Label18.TabIndex = 0x39;
            this.Label18.Text = "Số hợp đồng";
            point = new Point(0x6b, 0x77);
            this.TxtSoHopDong.Location = point;
            this.TxtSoHopDong.Name = "TxtSoHopDong";
            size = new Size(0x70, 20);
            this.TxtSoHopDong.Size = size;
            this.TxtSoHopDong.TabIndex = 0x3a;
            this.CboTinhTrang.FormattingEnabled = true;
            point = new Point(0x6b, 0x56);
            this.CboTinhTrang.Location = point;
            this.CboTinhTrang.Name = "CboTinhTrang";
            size = new Size(0x127, 0x15);
            this.CboTinhTrang.Size = size;
            this.CboTinhTrang.TabIndex = 0x38;
            this.Label19.AutoSize = true;
            point = new Point(12, 0x59);
            this.Label19.Location = point;
            this.Label19.Name = "Label19";
            size = new Size(0x37, 13);
            this.Label19.Size = size;
            this.Label19.TabIndex = 0x37;
            this.Label19.Text = "T\x00ecnh trạng";
            this.Label16.AutoEllipsis = true;
            this.Label16.AutoSize = true;
            point = new Point(12, 0x3a);
            this.Label16.Location = point;
            this.Label16.Name = "Label16";
            this.Label16.RightToLeft = RightToLeft.No;
            size = new Size(0x4b, 13);
            this.Label16.Size = size;
            this.Label16.TabIndex = 0x35;
            this.Label16.Text = "Nh\x00e0 cung cấp";
            this.Label16.TextAlign = ContentAlignment.TopRight;
            this.Label13.AutoSize = true;
            point = new Point(0xfc, 0x1d);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x20, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 0x33;
            this.Label13.Text = "Ng\x00e0y";
            this.TxtNgayChungTu.Enabled = false;
            this.TxtNgayChungTu.Format = DateTimePickerFormat.Short;
            point = new Point(0x131, 0x19);
            this.TxtNgayChungTu.Location = point;
            this.TxtNgayChungTu.Name = "TxtNgayChungTu";
            size = new Size(0x61, 20);
            this.TxtNgayChungTu.Size = size;
            this.TxtNgayChungTu.TabIndex = 0x34;
            this.Label1.AutoSize = true;
            point = new Point(12, 0x1c);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x45, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x31;
            this.Label1.Text = "Số đơn h\x00e0ng";
            point = new Point(0x6b, 0x19);
            this.TxtSoChungTu.Location = point;
            this.TxtSoChungTu.Name = "TxtSoChungTu";
            this.TxtSoChungTu.ReadOnly = true;
            size = new Size(0x70, 20);
            this.TxtSoChungTu.Size = size;
            this.TxtSoChungTu.TabIndex = 50;
            this.CmdCancel.DialogResult = DialogResult.Cancel;
            this.CmdCancel.Image = (Image) manager.GetObject("CmdCancel.Image");
            this.CmdCancel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x158, 0xde);
            this.CmdCancel.Location = point;
            this.CmdCancel.Name = "CmdCancel";
            size = new Size(0x4f, 0x18);
            this.CmdCancel.Size = size;
            this.CmdCancel.TabIndex = 6;
            this.CmdCancel.Text = "&Tho\x00e1t";
            this.CmdCancel.UseVisualStyleBackColor = true;
            this.CmdOK.Image = (Image) manager.GetObject("CmdOK.Image");
            this.CmdOK.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x105, 0xde);
            this.CmdOK.Location = point;
            this.CmdOK.Name = "CmdOK";
            size = new Size(0x4e, 0x18);
            this.CmdOK.Size = size;
            this.CmdOK.TabIndex = 5;
            this.CmdOK.Text = "&Chọn";
            this.CmdOK.UseVisualStyleBackColor = true;
            this.AdvNhaCungCap.LoaiDoiTuong = modGeneral.TypeObjects.NhaCungCap;
            point = new Point(0x6b, 0x37);
            this.AdvNhaCungCap.Location = point;
            this.AdvNhaCungCap.Name = "AdvNhaCungCap";
            this.AdvNhaCungCap.ReadOnly = true;
            size = new Size(0x127, 20);
            this.AdvNhaCungCap.Size = size;
            this.AdvNhaCungCap.TabIndex = 0x36;
            this.AdvNhaCungCap.UpperText = true;
            this.AdvNhaCungCap.Value = "";
            this.AdvNhaCungCap.WidthCode = 80;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x1ab, 250);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.CmdCancel);
            this.Controls.Add(this.CmdOK);
            this.Controls.Add(this.GroupBox1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Name = "Frm_XacNhanDonHang";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "XAC NHAN DON DAT HANG";
            this.GroupBox1.ResumeLayout(false);
            this.GroupBox1.PerformLayout();
            this.ResumeLayout(false);
        }

        public void ShowData(string pKhoa)
        {
            this.objDH.Load(pKhoa);
            this.TxtSoChungTu.Text = this.objDH.SoChungTu;
            this.TxtNgayChungTu.Text = LVYModule.Char2Date(this.objDH.NgayChungTu);
            this.CboTinhTrang.SelectedValue = this.objDH.TinhTrang;
            this.CboPhuongThucThanhToan.SelectedValue = this.objDH.PhuongThucThanhToan;
            this.AdvNhaCungCap.Value = this.objDH.KhoaDoiTuong;
            this.TxtSoHopDong.Text = this.objDH.SoHopDong.Trim();
            this.TxtNgayHopDong.Text = LVYModule.Char2Date(this.objDH.NgayHopDong);
            this.TxtHanGiaoHang.Text = LVYModule.Char2Date(this.objDH.NgayHangVeKho);
        }

        internal virtual ADVObjects AdvNhaCungCap
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvNhaCungCap;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvNhaCungCap = value;
            }
        }

        internal virtual ComboBox CboPhuongThucThanhToan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboPhuongThucThanhToan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboPhuongThucThanhToan = value;
            }
        }

        internal virtual ComboBox CboTinhTrang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboTinhTrang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboTinhTrang_SelectedIndexChanged);
                if (this._CboTinhTrang != null)
                {
                    this._CboTinhTrang.SelectedIndexChanged -= handler;
                }
                this._CboTinhTrang = value;
                if (this._CboTinhTrang != null)
                {
                    this._CboTinhTrang.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual Button CmdCancel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCancel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdCancel = value;
            }
        }

        internal virtual Button CmdOK
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdOK;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdOK_Click);
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click -= handler;
                }
                this._CmdOK = value;
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click += handler;
                }
            }
        }

        internal virtual GroupBox GroupBox1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox1 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label16
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label16;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label16 = value;
            }
        }

        internal virtual Label Label18
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label18;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label18 = value;
            }
        }

        internal virtual Label Label19
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label19;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label19 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual Label Label8
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label8;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label8 = value;
            }
        }

        internal virtual DateTimePicker TxtHanGiaoHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtHanGiaoHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtHanGiaoHang = value;
            }
        }

        internal virtual DateTimePicker TxtNgayChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayChungTu = value;
            }
        }

        internal virtual DateTimePicker TxtNgayHopDong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayHopDong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayHopDong = value;
            }
        }

        internal virtual TextBox TxtSoChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoChungTu = value;
            }
        }

        internal virtual TextBox TxtSoHopDong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoHopDong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoHopDong = value;
            }
        }
    }
}

